

$(document).ready(function(){
	var userId=getvl("userId");
	getLoanQuestionReocrd(userId);
	
});



/**
 * 获取催款记录题
 */

function getLoanQuestionReocrd(userId){
	$.ajax({
		url: urlcore + "/api/auditRecord/selectAuditRecord?userId="+userId,
		type: "get",
		async:'false',
		dataType: 'json',
		contentType: "application/json;charset=utf-8",
		success: function(data) {
    	if(data.success == true) {
    		  var da=data.data;
    		  var firstRecords="",secondRecords="",lastRecords="",firstque="",secondque="",lastque="";
    		  if(da.firstRecords!=null){
    		  	firstRecords=da.firstRecords;
    		  }
    		  if(da.secondRecords!=null){
    		  	secondRecords=da.secondRecords;
    		  }
    		  if(da.lastRecords!=null){
    		  	lastRecords=da.lastRecords;
    		  }
    		 var html="",html2="",html3="";
    		 html+="<h4 style=\"color: #3399ff;\">&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;一催情况</h4>";
    		 html2+="<h4 style=\"color: #3399ff;\">&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;二催情况</h4>";
    		 html3+="<h4 style=\"color: #3399ff;\">&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;三催情况</h4>"
    		for(var i=0;i<firstRecords.length;i++){
    			 firstque=firstRecords[i].questions;
    			var answerqustion=firstRecords[i].answerquetion;
    			if(firstque.length!=1){
    				html+="<h6>&nbsp;"+answerqustion.title+":&nbsp;&nbsp;";
    				for(var m=0;m<firstque.length;m++){
    					var check="";
    					if(firstque[m].id==answerqustion.id){
    						check="checked";
    					}
    				html+="<label class=\"radio\"><input type=\"radio\" name=\"group-radio"+firstque[m].id+"\" class=\"inpu\" "+check+"  disabled/><i class=\"icon-radio\"></i></label>"+
					      "<label type=\"text\" class=\"input-sm\">"+firstque[m].queOption+"</label>"
    				}
    				html+="</h6>";
    			}else{
    					html+= "<h6 >&nbsp;"+answerqustion.title+":&nbsp;&nbsp;<label type=\"text\" >"+answerqustion.answer+"</label></h6>";
    				}
    				
    			}
    		if(firstRecords!=""){
			  html+="<h6 >&nbsp;一催人员:&nbsp;&nbsp;<label type=\"text\" >"+da.firstReminderAdmin.name+"</label>"+
    		        "&nbsp;&nbsp;&nbsp;&nbsp;一催时间&nbsp;&nbsp;<label type=\"text\" >"+new Date(firstRecords[0].time).pattern("yyyy-MM-dd hh:mm:ss")+"</label></h6>";
    		  html+="<div class=\"fengexian\" style=\"height:1px;width:100%;background:#CCCCCC;overflow:hidden;\"></div>";
    		  $("#firstdiv").html(html);
    		  $("#hiddiv").hide();
    		}
    		
    		 for(var i=0;i<secondRecords.length;i++){
		 		 secondque=secondRecords[i].questions;
    			var answerqustion=secondRecords[i].answerquetion;
    			if(secondque.length!=1){
    				html2+="<h6>&nbsp;"+answerqustion.title+":&nbsp;&nbsp;";
    				for(var m=0;m<secondque.length;m++){
    					var check="";
    					if(secondque[m].id==answerqustion.id){
    						check="checked";
    					}
    				html2+="<label class=\"radio\"><input type=\"radio\" name=\"group-radio"+secondque[m].id+"\" class=\"inpu\" "+check+"  disabled/><i class=\"icon-radio\"></i></label>"+
					      "<label type=\"text\" class=\"input-sm\">"+secondque[m].queOption+"</label>"
    				}
    				html2+="</h6>";
    			}else{
    					html2+=  "<h6 >&nbsp;"+answerqustion.title+":&nbsp;&nbsp;<label type=\"text\" >"+answerqustion.answer+"</label></h6>";
    				}
    				
    			}
    		 if(secondRecords!=""){
		 	  html2+="<h6 >&nbsp;二催人员:&nbsp;&nbsp;<label type=\"text\" >"+da.secondReminderAdmin.name+"</label>"+
    		        "&nbsp;&nbsp;&nbsp;&nbsp;二催时间&nbsp;&nbsp;<label type=\"text\" >"+new Date(secondRecords[0].time).pattern("yyyy-MM-dd hh:mm:ss")+"</label></h6>";
    		  html2+="<div class=\"fengexian\" style=\"height:1px;width:100%;background:#CCCCCC;overflow:hidden;\"></div>";
    		  $("#seconddiv").html(html2);
    		  $("#hiddiv").hide();
    		 }
			 for(var i=0;i<lastRecords.length;i++){
		 		 lastque=lastRecords[i].questions;
    			var answerqustion=lastRecords[i].answerquetion;
    			if(lastque.length!=1){
    				html3+="<h6>&nbsp;"+answerqustion.title+":&nbsp;&nbsp;";
    				for(var m=0;m<lastque.length;m++){
    					var check="";
    					if(lastque[m].id==answerqustion.id){
    						check="checked";
    					}
    				html3+="<label class=\"radio\"><input type=\"radio\" name=\"group-radio"+lastque[m].id+"\" class=\"inpu\" "+check+"  disabled/><i class=\"icon-radio\"></i></label>"+
					      "<label type=\"text\" class=\"input-sm\">"+lastque[m].queOption+"</label>"
    				}
    				html3+="</h6>";
    			}else{
    					html3+=  "<h6 >&nbsp;"+answerqustion.title+":&nbsp;&nbsp;<label type=\"text\" >"+answerqustion.answer+"</label></h6>";
    				}
    				
    			}
    		 if(lastRecords!=""){
		 	  html3+="<h6 >&nbsp;催收总管:&nbsp;&nbsp;<label type=\"text\" >"+da.lastReminderAdmin.name+"</label>"+
    		        "&nbsp;&nbsp;&nbsp;&nbsp;时间&nbsp;&nbsp;<label type=\"text\" >"+new Date(lastRecords[0].time).pattern("yyyy-MM-dd hh:mm:ss")+"</label></h6>";
    		  html3+="<div class=\"fengexian\" style=\"height:1px;width:100%;background:#CCCCCC;overflow:hidden;\"></div>";
    		  $("#lastdiv").html(html3);
    		  $("#hiddiv").hide();
    		 }
    		 	
    		 }
    		 
    		}
    		
   });
}